package com.micro.entity;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 酒店订单实体类
 */
@Data
@TableName("hotel_orders")
public class HotelOrder {

    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    @TableField("user_id")
    private Long userId;

    @TableField("hotel_id")
    private Long hotelId;

    @TableField("check_in_date")
    private LocalDate checkInDate;

    @TableField("check_out_date")
    private LocalDate checkOutDate;

    @TableField("order_status")
    private OrderStatus orderStatus = OrderStatus.BOOKED;

    @TableField("payment_amount")
    private BigDecimal paymentAmount;

    @TableField("payment_method")
    private String paymentMethod;

    @TableField("payment_time")
    private LocalDateTime paymentTime;

    @TableField("refund_amount")
    private BigDecimal refundAmount;

    @TableField("refund_time")
    private LocalDateTime refundTime;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField("expire_time")
    private LocalDateTime expireTime;

    @TableLogic
    @TableField("deleted")
    private Integer deleted;

    /**
     * 订单状态枚举
     */
    public enum OrderStatus {
        BOOKED,       // 已预订
        CHECKED_IN,   // 已入住
        REFUNDED      // 已退款
    }
}